package com.zz.controller;

import com.zz.domain.User;
import com.zz.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author: zhangzhen
 * DATE: Created in 2018/12/12 16:41
 * Description:
 */
@RestController
public class UserRestController {

    @Autowired
    private UserService userService;

    /**
     * 根据用户名获取用户信息,包括从库的地址信息
     * @param userName
     * @return
     */

    @RequestMapping(value = "/api/user", method = RequestMethod.GET)
    public User findByName(@RequestParam(value = "userName",required = true)String userName) {
        return userService.findByName(userName);
    }


}
